clear all

** Set working directory: please set your own
/*
cd "~/Dropbox/sanctions_replication/"
*/
** Open dataset
use data/survey_clean.dta, clear

* Generate dummy for left-wing individuals
gen dummy_left = 0
replace dummy_left = 1 if left_right_self > 5

* Run the analyses
* Physical sanctions, attitudes and emotions
regr intent_phis_vox_num dummy_left pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store vox_phis_dummy

* Verbal sanctions, attitudes and emotions
regr intent_verb_vox_num dummy_left pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store vox_verbal_dummy

* Insult, attitudes and emotions
regr intent_insult_vox_num dummy_left pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store vox_insult_dummy

* PCA direct sanctions, attitudes and emotions
regr pca_direct dummy_left pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store pca_direct_dummy

* Deny help, attitudes and emotions
regr intent_deny_vox_num dummy_left pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store vox_deny_dummy

* Avoid Interaction, attitudes and emotions
regr intent_avoid_vox_num dummy_left pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store vox_avoid_dummy

* Gossip, attitudes and emotions
regr intent_gossip_vox_num dummy_left pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store vox_gossip_dummy

* PCA indirect sanctions, attitudes and emotions
regr pca_indirect dummy_left pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store pca_indirect_dummy

* PCA all sanctions, attitudes and emotions
regr pca_all dummy_left pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store pca_all_dummy

* Make table
esttab vox_phis_dummy vox_verbal_dummy vox_insult_dummy pca_direct_dummy vox_deny_dummy vox_avoid_dummy vox_gossip_dummy pca_indirect_dummy pca_all_dummy ///
using tables/tableb10.tex, tex nonumber ///
mtitles("Physical" "Verbal"  "Insult"   "Dir sanct (PCA)" "Gossip" "Deny help"  "Avoid interact"  "Ind sanct (PCA)"  "All sanctions (PCA)" ) ///
coeflabels(dummy_left "Left-wing respondent (dummy)" ///
pol_interest "Political interest" happy_vox_num "Happiness" ///
anger_vox_num "Anger" disgust_vox_num "Disgust" fear_vox_num "Fear" sad_vox_num "Sadness" _cons "Constant") se ///
replace addnotes("Standard errors are robust")
